<template>
  <div>
    <div class="assessment-container">
      <div class="table-top"><span>{{date}} {{xb}} {{total}}</span></div>
      <div class="export-right">
        <div  class="export-top">
          <img src="../../../../assets/assessment/icon-export.png" alt="" />
          <download-excel
            class="export-btn"
            :data="tableData"
            :fields="jsonFields"
            type="xls"
            name="时间段课表.xls"
            style="color: #f3b815"
          >
            &ensp;导出Excel
          </download-excel>
        </div>
      </div>
      <div class="table-container">
        <el-table
          :data="tableData"
          border
          class="table-data"
          row-class-name="row-class"
          cell-class-name="cell-class"
          header-row-class-name="header-row-class"
          header-cell-class-name="header-cell-class"
          style="height: calc(100vh - 280px); overflow-y: auto"
        >
          <el-table-column prop="courseName" label="课程名称" align="center">
          </el-table-column>
          <el-table-column prop="courseJc" label="节次" align="center">
          </el-table-column>
          <el-table-column prop="courseper" label="主讲教员" align="center">
          </el-table-column>
          <el-table-column prop="assistant" label="助教" align="center">
          </el-table-column>
          <el-table-column prop="courseClass" label="教学班" align="center">
          </el-table-column>
          <el-table-column prop="courseplace" label="教学场地" align="center">
          </el-table-column>
        </el-table>
      </div>
    </div>
    <!-- <div class="wrapper-container">
      <div class="bottom-block" style="display: block">
        <div class="text">当前共找到200条记录,当前显示51-100条</div>
      </div>
      <div class="pagination-block">
        <el-pagination
          prev-text="上一页"
          next-text="下一页"
          :page-size="100"
          layout="prev, pager, next, jumper"
          :total="1000"
        >
        </el-pagination>
      </div>
    </div> -->
  </div>
</template>

<script>
import tablelist from "@/views/comonents/tablelist";
import ButtonItem from "@/components/ButtonItem.vue";
import {kscx_kcb_bm_details} from "@/api/trainingManagement/place.js";
export default {
  components: {
    tablelist,
    ButtonItem,
  },
  data() {
    return {
      tableData: [],
      kcmc: "",
      date: "",
      xb: "", //系别
      total: "",//总数
      fDate: ''
    };
  },
  created() {},
  mounted() {
    this.kcmc = this.$route.query.kcmc;
    this.date = this.$route.query.date;
    this.ffDate()
    this.queryList();
  },
  methods: {
    ffDate(){
      console.log(this.date.split('至'))
      this.fDate = "2022-" + this.date.split('至')[0]
    },
    async queryList() {
      var data = {
        "date":this.fDate,
        "xb":this.xb
      }
      const res = await kscx_kcb_bm_details(data);
      if (res.data.code == 200) {
         this.tableData= res.data.data;
        this.total = this.tableData.length;
      }
    }
  },
  computed: {}, //计算属性
};
</script>
<style lang="less" scoped>
.assessment-container {
  .el-dialog__body {
    height: 251px;
  }
  .el-dialog__footer {
    padding: 10px 20px 45px;
  }
  .el-checkbox__inner:hover {
    border-color: #004ca7;
  }
  .el-checkbox__inner {
    border: 1px solid #004ca7;
    border-radius: 0;
    height: 18px;
    width: 18px;
  }
  .el-checkbox__inner::after {
    height: 10px;
    left: 6px;
  }
  .el-checkbox__input.is-checked .el-checkbox__inner,
  .el-checkbox__input.is-indeterminate .el-checkbox__inner {
    background-color: #004ca7;
    border-color: #004ca7;
  }
  .el-checkbox__input.is-checked + .el-checkbox__label {
    color: #004ca7;
  }
  .el-checkbox.is-bordered.is-checked {
    border-color: #004ca7;
  }
  .el-checkbox__input.is-focus .el-checkbox__inner {
    border-color: #004ca7;
  }
}
</style>
<style lang="less" scoped>
@import "../../../../styles/text.less";
.pagination-block {
  margin-top: 20px;
  display: flex;
  flex-direction: row;
  justify-content: center;
}
</style>
<style lang="less" scoped>
@import "../../../../styles/supervision.less";

.wrapper-container {
  width: 1711px;
  margin: 0 auto;
}

/deep/ .table-container {
  .el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }

  .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }

  .el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }

  .wrapper-button {
    display: flex;
    flex-direction: column;
    align-items: center;

    > div {
      margin-bottom: 8px;
    }
  }
  .table-data {
    width: 100%;
    border: 0.8px solid #004ca7;
    /*border-radius: 9px;*/
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #004ca7;
  }
}

.wrapper-container .search-container .search-container-left {
  flex-wrap: wrap;
  .search-container-item {
    width: 12%;
    margin-right: 0px;
    .box {
      > span {
        text-align: left;
      }
      display: flex;
      justify-content: space-evenly;
      margin-bottom: 20px;
      align-items: center;
    }
  }
}

/deep/.el-date-editor.el-input {
  width: 110px;
}
/deep/ .el-input--medium {
  width: 110px;
  .el-input__inner {
    height: 28px;
    width: 110px;
    padding: 0px 18px;
  }
}
/deep/ .el-table thead {
  color: #004ca7 !important;
}

.bottom-block {
  // display: flex;
  flex-direction: row;
  justify-content: space-between !important;
  .export-button {
    width: 127px;
    height: 27px;
    background: #fff6ef;
    border: 1px solid #f3b815;
    border-radius: 4px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    > img {
      width: 17px;
      height: 17px;
    }
    > span {
      margin-left: 12px;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #f3b815;
    }
  }
  .text {
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    line-height: 39px;
    color: #004ca7;
  }
}

.table-top {
  margin: 30px;
  color: #004ca7;
  font-size: 18px;
  > span {
    font-weight: bold;
  }
}
.export-right {
  display: flex;
  align-items: center;
  justify-content: end;
  margin-right: 70px;
  margin-top: -55px;
}

.assessment-container {
  width: calc(100% - 20px);
  .table-container {
    width: 100%;
  }
}

.export-top {
  cursor: pointer;
  width: 127px;
  height: 27px;
  background: #fff6ef;
  border: 1px solid #f3b815;
  border-radius: 4px;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  flex-direction: row;
  -webkit-box-align: center;
  align-items: center;
  -webkit-box-pack: center;
  justify-content: center;
  > img {
    width: 17px;
    height: 17px;
  }
}
</style>
